{extend  name="manage@public/layout" /}
{block name="content"}
    <div class="wrapper wrapper-content animated fadeInRight">
        <div class="row">
            <div class="col-sm-12">
                <div class="ibox float-e-margins">
                    <div class="ibox-title">
                        <h5 style="margin:-5px 5px 0px !important;"><button onClick="editType('添加支付类型','/manage/addPayment')" style="padding:4px;margin-bottom:0 !important" type="button" class="btn btn-primary btn-xs">添加支付方式</button></h5>
                        <div class="ibox-tools">
                            <a class="collapse-link" onclick="location.replace(location.href);">
                                <i class="fa fa-refresh"></i>
                            </a>
                        </div>
                    </div>
                    <div class="ibox-content">
                        <div class="table-responsive">
                            <!--- 搜索--->
                            <form action="" method="post">
                                <div class="col-sm-2 m-b-xs col-sm-on">
                                    <select name="paytype_id" class="input-sm form-control input-s-sm inline">
                                        <option value="0">请选择支付类型</option>
                                        {volist name="paymentType" id="vo"}
                                        <option {notempty name="data['paytype_id']"}{eq name="data['paytype_id']" value="$key"}selected{/eq}{/notempty} value="{$key}">{$vo}</option>
                                        {/volist}
                                    </select>
                                </div>
                                <div class="col-sm-2 m-b-xs col-sm-on">
                                    <select name="channel_id" class="input-sm form-control input-s-sm inline">
                                        <option value="0">请选择渠道</option>
                                        {volist name="channel" id="vo"}
                                        <option {notempty name="data['channel_id']"}{eq name="data['channel_id']" value="$vo.id"}selected{/eq}{/notempty}  value="{$vo.id}"  >{$vo.title}</option>
                                        {/volist}
                                    </select>
                                </div>
                                <div class="col-sm-1 col-sm-botton">
                                    <div class="input-group">
                                        <button type="submit" class="btn btn-sm btn-primary"><i class="fa fa-search"></i></button>
                                    </div>
                                </div>
                            </form>
                            <!--- end --->
                            <table class="table table-striped table-bordered">
                                <thead>
                                    <tr>
                                        <th>ID</th>
                                        <th>渠道名称</th>
                                        <th>支付类型</th>
                                        <th>渠道编码</th>
                                        <th>成本费率(%)</th>
                                      
                                        <th>当日限额</th>
                                        <th>最低金额</th>
                                        <th>最高金额</th>
                                        <th>固定金额</th>
                                        <th>倍数金额</th>
                                        <th>排除尾数</th>
                                        <th>结算方式</th>
                                        <th>状态</th>
                                        <th>操作</th>
                                    </tr>
                                </thead>
                                <tbody>
                                    {volist name="list" id="vo"}
                                    <tr>
                                        <td>{$vo.id}</td>
                                        <td>{:\\app\\model\\Channel::channel_name($vo.channel_id)}</td>
                                        <td>{:\\app\\model\\Channel::paymentType($vo.pay_type)}</td>
                                        <td>{$vo.code}</td>
                                        <td>{$vo.cost}</td>
                                      
                                        <td>{$vo.qualified|abs|default=''}</td>
                                        <td>{$vo.min_amount|abs|default=''}</td>
                                        <td>{$vo.max_amount|abs|default=''}</td>
                                        <td>{$vo.fixed_amount|default=''}</td>
                                        <td>{$vo.double_amount|abs|default=''}</td>
                                        <td>{$vo.exclude_tail|abs|default=''}</td>
                                        <td>
                                            {eq name="vo.settlement" value="1"}
                                            <span class="mch_settlement settlement_{$vo.id}" tt="{$vo.id}" style="cursor: pointer;">D0</span>
                                            {else/}
                                            <span class="mch_settlement settlement_{$vo.id}" tt="{$vo.id}" style="cursor: pointer;">T1</span>
                                            {/eq}
                                            
                                        </td>
                                        <td>
                                            <input data-type="ch" data-url="{:url('/manage/stateType')}" {eq  name="vo.status" value="1"}checked{/eq} data-id="{$vo.id}" type="checkbox" class="js-switch"  />
                                        </td>
                                        <td>
                                            <button style="color: #1ab394;border: 1px solid #1ab394;" onClick="editType('添加支付类型','{:url('/manage/addPayment',['id'=>$vo.id])}')" title="编辑" type="button" data-id="{$vo.id}" class="btn btn-sm btn-white"><i class="fa fa-edit">&nbsp;编辑</i></button>
                                            <button style="color:red;border:1px solid red;" title="删除" type="button" data-id="{$vo.id}" class="btn btn-sm bt-pay-del btn-white"><i class="fa fa-trash-o">&nbsp;删除</i></button>
                                        </td>
                                    </tr>
                                    {/volist}
                                </tbody>
                            </table>
                            <div style="float:right;" class="dataTables_paginate paging_simple_numbers" id="DataTables_Table_0_paginate">
                                {$page|raw}
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div> 
</body>
{/block}
{block name="script"}
<script src="/static/js/admin/channel.js"></script>
<script>
    function editType(title,url) {
        parent.layer.open({
            type: 2,
            title: title,
            shadeClose: true,
            shade: 0.4,
            area: ['600px', '500px'],
            content: url,
            //iframe层销毁后触发
            end:function(){
                window.location.href = "/manage/payment";
            },
        });   
    }
</script>
{/block}

